import { handleGetAllUsers, requireAuth } from "./auth-routes";

// 用户管理相关路由
export const userRoutes = {
  "/api/users": {
    GET: handleGetAllUsers
  },

  // 动态路由 - 需要认证
  "/users/:id": requireAuth(req => {
    const url = new URL(req.url);
    const pathParts = url.pathname.split('/');
    const userId = pathParts[pathParts.length - 1];
    
    console.log("🔍 收到用户请求:", {
      url: req.url,
      method: req.method,
      userId: userId
    });
    
    console.log("👤 用户ID:", userId);
    
    return new Response(`Hello User ${userId}!`);
  })
};
